class LightController < ApplicationController
	layout "standard-layout"
	def index
	end

	def list
	end

	def send_impl(str)
		begin
			sock = TCPSocket.new('localhost', 12346)
			sock.puts(str)
			sock.close()
		rescue
		end
	end

	def turn_on
		send_impl("<light signal=\"on\"/>")
		render :partial => "list"
	end

	def turn_off
		send_impl("<light signal=\"off\"/>")
		render :partial => "list"
	end

	def turn_auto
		send_impl("<light signal=\"auto\"/>")
		render :partial => "list"
	end
end
